﻿using System.Collections.Generic;
using Fuse8.DomainFramework.DataAccess.SqlDatabase;
using Fuse8.GlobalizationFramework.Domain;

namespace Fuse8.GlobalizationFramework.DataAccess.SqlRepository
{
    internal class ResourceSqlRepository : SqlEntityDataRepository<Resource, int>
    {
        private ISqlEntityDataMapper<Resource, int> mapper;

        public override string AddSpName
        {
            get
            {
                return "gf_usp_ResourceAdd";
            }            
        }

        public override string UpdateSpName
        {
            get
            {
                return "gf_usp_ResourceUpdate";
            }            
        }

        public override string RemoveSpName
        {
            get
            {
                return "gf_usp_ResourceDelete";
            }
        }

        public override string FindAllSpName
        {
            get { return "gf_usp_ResourceSelectAll"; }            
        }

        public override string FindOneSpName
        {
            get { return "gf_usp_ResourceSelectOne"; }            
        }

        protected override ISqlEntityDataMapper<Resource, int> Mapper
        {
            get
            {
                return mapper ??
                       (mapper =
                        SqlEntityDataRepositoryConfiguration<Resource, int>.CreateMapper(new List<string>()
                                                                                             {
                                                                                                 "Translated",
                                                                                                 "PublicGroupId"
                                                                                             }));
            }
            set
            {
                
            }
        }
    }
}